package cn.iocoder.yudao.module.distm.dal.mysql.loss;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.distm.dal.dataobject.loss.MealLossRecordDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.distm.controller.admin.loss.vo.*;

/**
 * 配送管理-餐食损耗记录 Mapper
 *
 * @author yisla
 */
@Mapper
public interface MealLossRecordMapper extends BaseMapperX<MealLossRecordDO> {

    default PageResult<MealLossRecordDO> selectPage(MealLossRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MealLossRecordDO>()
                .eqIfPresent(MealLossRecordDO::getFlightNo, reqVO.getFlightNo())
                .eqIfPresent(MealLossRecordDO::getSupplyType, reqVO.getSupplyType())
                .betweenIfPresent(MealLossRecordDO::getFlightDate, reqVO.getFlightDate())
                .orderByDesc(MealLossRecordDO::getId));
    }

}